 <!-- sidbar -->
 <script>
 
 function openlinkcheck(linkto)
 {
 console.log(typeof(checkaddbook));
 if(typeof(checkaddbook) != "undefined")
 {
 if(confirm('ต้องการบันทึกข้อมูลก่อนหรือไม่'))
 {
 
 savebook();
 
 
 }else
 {
 location.href=linkto;
 
 }
 
 }else
 {
  location.href=linkto;
 
 }

 
 }
 
 </script>
                        <div class="wrpSideBar">
                            <div class="wrpUserTab">
                                    <img src="<?if($this->data['userpremium']['photo']){ echo imginfo.'/user/'.$this->data['userpremium']['userid'].'/'.$this->data['userpremium']['photo']; }else{?>img/usersidebarmoc.png<?}?>" class="imgUserTab">
                                    <div class="wrpTextUserTab">
                                        <h5 class="userNameTab"><? if($this->data['userpremium']['firstname']==''){
                                        
                                        echo $this->data['userpremium']['username'];
                                        
                                        }else
                                        {
                                        
                                        echo $this->data['userpremium']['firstname'];
                                        
                                        
                                        }
                                        
                                        
                                        ?></h5>
                                        <em class="userStatus">User</em>
                                    </div>
                                    <i class="iArrow arDown"></i>
                                </div>
                                <div class="wrpSideBarInner">
                                <div class="wrpListRowSection">
                                    <div class="wrpListRowSectionInner">

                                        <div id="wrpPageMenu">
                                            <ul id="ulPageMenu">
                                                <li class="liHeaderSection"><h4 class="h4Cat">หมวดหมู่เอกสาร</h4></li>
                                                <? $active="";
                                                 if($_GET['nouser']&&!$_GET['tagid'])
                                                 {
                                                    $active="active";
                                                 }?>
                                                <li class="liPageNav"><a data-href="allTags" onclick="openlinkcheck('<?=baseinfo?>?nouser=1&shelfid=<?=$this->data['userpremium']['shelfid']?>')" href="javascript:void(0)" class="aLiTag <?=$active?>">แสดงทั้งหมด</a></li>
                                                <!--<li class="liPageNav"><a data-href="tag1" class="aLiTag">Tage1</a></li>
                                                <li class="liPageNav"><a data-href="tag2" class="aLiTag">Tage2</a></li>-->
                                                
                                                 <?
                                                 if(count($this->data['useralltag']))
                                                 {
                                                 foreach($this->data['useralltag'] as $valuetag)
                                                 {
                                                 $active="";
                                                 if($_GET['nouser']&&$_GET['tagid']==$valuetag['tagid'])
                                                 {
                                                 $active="active";
                                                 $namecat=$valuetag['name'];
                                                 
                                                 }
                                                 
                                                 echo '<li class="liUserMenu"><a data-href="taguser'.$valuetag['tagid'].'" onclick="openlinkcheck(\''.baseinfo.'?nouser=1&tagid='.$valuetag['tagid'].'&shelfid='.$this->data['userpremium']['shelfid'].'\')" href="javascript:void(0)"  class="aLiTag '.$active.'">'.$valuetag['name'].'</a></li>';
                                                 
                                                 
                                                 }
                                                
                                                
                                                }
                                                
                                                ?>
                                                
                                            </ul>
                                        </div>
                                                                                <div class="wrpUserMenu" style="display: block;">
                                            <ul id="ulUserMenu">
                                            <!--    <li class="liHeaderSection"><h4 class="h4Cat">หมวดหมู่เอกสาร</h4></li>-->
<!--                                                <li class="liUserMenu"><a data-href="taguser1" class="aLiTag">taguser1</a></li>
                                                <li class="liUserMenu"><a data-href="taguser2" class="aLiTag">taguser2</a></li>
                                                <li class="liUserMenu"><a data-href="taguser1" class="aLiTag">taguser1</a></li>
                                                <li class="liUserMenu"><a data-href="taguser2" class="aLiTag">taguser2</a></li>
                                                <li class="liUserMenu"><a data-href="taguser1" class="aLiTag">taguser1</a></li>
                                                <li class="liUserMenu"><a data-href="taguser2" class="aLiTag">taguser2</a></li>
                                                <li class="liUserMenu"><a data-href="taguser1" class="aLiTag">taguser1</a></li>
                                                <li class="liUserMenu"><a data-href="taguser2" class="aLiTag">taguser2</a></li>
                                                <li class="liUserMenu"><a data-href="taguser1" class="aLiTag">taguser1</a></li>-->
                                                <?
                                             //   if(count($this->data['usermytag']))
//                                                {
//                                                 foreach($this->data['usermytag'] as $valuetag)
//                                                 {
//                                                 $active="";
//                                                 if(!$_GET['nouser']&&$_GET['tagid']==$valuetag['tagid'])
//                                                 {
//                                                 $active="active";
//                                                 $namecat=$valuetag['name'];
//                                                 }
//                                                 
//                                                 echo '<li class="liUserMenu"><a data-href="taguser'.$valuetag['tagid'].'" href="'.baseinfo.'?tagid='.$valuetag['tagid'].'&shelfid='.$this->data['userpremium']['shelfid'].'" class="aLiTag '.$active.'">'.$valuetag['name'].'</a></li>';
//                                                 
//                                                 }
//                                                
//                                                
//                                                }
//                                                
                                                
                                                ?>
                                                
                                                

                                                <li class="liHeaderSection"><h4 class="h4Cat">รายละเอียดส่วนตัว</h4></li>
                                                <?
                                                $active="";
                                                if($this->data['fileset']=="stat"){$active="active";}
                                                ?>
                                            <!--    <li class="liUserMenu"><a data-href="stats" href="<?=baseinfo?>/stat?shelfid=<?=$this->data['userpremium']['shelfid']?>" class="aLiTag <?=$active?>">Statistic</a></li>-->
                                                <?
                                                $active="";
                                                if($this->data['fileset']=="usersetting"){$active="active";}
                                                ?>
                                                <li class="liUserMenu"><a data-href="settingProfile" class="aLiTag <?=$active?>" href="<?=baseinfo?>/usersetting?shelfid=<?=$this->data['userpremium']['shelfid']?>" >ตั้งค่าการใช้งาน</a></li>
                                                <li class="liUserMenu"><a data-href="userLogOut" class="aLiTag" onclick="logout()" >ออกจากระบบ</a></li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>